<?php
getCatOptions();
if (!empty($_POST)) {
   $_CLEAN = cleanInput($_POST);
   if (is_array($_CLEAN)) {
        $productArray = formatProductArray($_CLEAN);
        updateQueueFile($productArray);
    } else $errors = $_CLEAN;
}
if (!empty($_GET['reset'])) {resetQueueFile(($_GET['reset']=='surewhynot'));}
if ((!empty($_GET['act']) && $_GET['act'] == 'd') && ((!empty($_GET['i']) && is_int((int)$_GET['i'])))) {deleteItem($_GET['i']);reloadPage();}
if (($queue = readQueueFile('sexy.csv')) !== false) {$queueContent = formatQueue($queue);}
else $queueContent = '';
?>